<% layout('layout.ejs') -%>
<div ng-controller="ConfigManageCtr">
<button class="btn btn-primary" onclick="window.location='/add_or_edit_config'">新增</button>
<button class="btn btn-primary" ng-click="deleteAll()">删除</button>
<button class="btn btn-primary">排序</button>
<div style="width: 100%;height: 20px;"></div>
<div class="box">
    <div class="box-header">
        <h3 class="box-title">配置列表</h3>
        <div class="box-tools">
            <div class="input-group" style="width: 150px;">
                <input class="form-control input-sm pull-right" type="text" placeholder="Search" name="table_search">
                <div class="input-group-btn">
                    <button class="btn btn-sm btn-default">
                        <i class="fa fa-search"></i>
                    </button>
                </div>
            </div>
        </div>
    </div>
    <!--列表-->
    <div class="box-body table-responsive no-padding">
        <table class="table table-hover">
            <tbody>
            <tr>
                <th><input type="checkbox"></th>
                <th>ID</th>
                <th>名称</th>
                <th>标题</th>
                <th>分组</th>
                <th>类型</th>
                <th>操作</th>
            </tr>
            <tr ng-repeat="config in Configs  track by $index">
                <td><input type="checkbox" ng-click="check($event,$index)" ng-checked="isChecked($index)"></td>
                <td ng-bind="config.id"></td>
                <td ng-bind="config.name"></td>
                <td ng-bind="config.title"></td>
                <td ng-bind="config.group"></td>
                <td ng-bind="config.type"></td>
                <td>
                    <button class="btn" ng-click="edit($index)">编辑</button>
                    <button class="btn" ng-click="delete($index)">删除</button>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <!--分页-->
    <div class="box-footer clearfix">
        <ul id="pagination" class="pagination pagination-sm no-margin pull-right">
        </ul>
    </div>
</div>
</div>
<% block('footer').append('<script src="/script/basedata.js"></script>') %>
<% block('footer').append('<script src="/script/filters.js"></script>') %>
<script>
    $(function () {
        var pagecount = '<%=count%>';
        var pagesize = '<%=pagesize%>';
        var currentpage = '<%=pageIndex%>';
        pager("configManage",pagecount,pagesize,currentpage);
    });
</script>